<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org" s>
<head>
    <meta charset="UTF-8">
    <title>个人中心</title>
    <script src="layui/layui.js"></script>
    <link rel="stylesheet" href="layui/css/layui.css" />
    <script src="https://code.jquery.com/jquery-2.1.1.min.js"></script>
</head>

<body>
<div class="layui-row">
    <div th:insert="~{header::topbar}"></div>
</div>
<div class="layui-col-md10 layui-col-lg-offset1">
<fieldset class="layui-elem-field layui-field-title" style="margin-top: 50px;">
    <legend>个人中心</legend>
</fieldset>
</div>
<div class="layui-col-md10 layui-col-lg-offset1">
<div class="layui-collapse" lay-accordion="">
    <div class="layui-colla-item">
        <h2 class="layui-colla-title">昵称</h2>
        <div class="layui-colla-content layui-show">
            <p th:text="${session.user.getNickname()}"></p>
        </div>
    </div><div class="layui-colla-item">
    <h2 class="layui-colla-title">头像</h2>
    <div class="layui-colla-content">
        <img th:src="@{${session.user.getHeadicon()}}" width="300" height="200">
    </div>
</div>
    <div class="layui-colla-item">
        <h2 class="layui-colla-title">手机号</h2>
        <div class="layui-colla-content">
            <p th:text="${session.user.getTelenum()}"></p>
        </div>
    </div>
    <div class="layui-colla-item">
        <h2 class="layui-colla-title">性别</h2>
        <div class="layui-colla-content">
            <p th:text="${session.user.getSex()}"></p>
        </div>
    </div>
    <div class="layui-colla-item">
        <h2 class="layui-colla-title">生日</h2>
        <div class="layui-colla-content">
            <span th:text="${session.user.getBirthday()}"></span>
        </div>
    </div>
    <div class="layui-colla-item">
        <h2 class="layui-colla-title">家乡</h2>
        <div class="layui-colla-content">
            <span th:text="'来自' + ${session.user.getDwells()}"></span>
        </div>
    </div>
    <div class="layui-colla-item">
        <h2 class="layui-colla-title">学院信息</h2>
        <div class="layui-colla-content">
            <span th:text="'是'+${session.user.getCollege()}+'学院' + ${session.user.getMajor()} + '专业' + ${session.user.getGrade()}+'级的学生'"></span>
        </div>
    </div>
    <div class="layui-colla-item">
        <h2 class="layui-colla-title">宿舍</h2>
        <div class="layui-colla-content">
            <span th:text="${session.user.getDormitory()}">空</span>
        </div>
    </div>
    <div class="layui-colla-item">
        <h2 class="layui-colla-title">余额</h2>
        <div class="layui-colla-content">
            <span th:text="${session.user.getBalance()}">空</span>
            <form class="layui-form" action="" th:action="@{/toeditBalance}" >
                <div class="layui-form-item">
                    <label class="layui-form-label">密码</label>
                    <div class="layui-input-inline">
                        <input type="text" name="modifyBalance" required lay-verify="required" placeholder="请输入要充值的余额" autocomplete="off"
                               class="layui-input">
                    </div>
                    <form class="layui-form" action="" th:action="@{/toeditBalance}">
                        <div class="layui-form-item">
                            <div class="layui-input-block">
                                <button class="layui-btn layui-btn-warm">充值余额</button>
                            </div>
                        </div>
                    </form>
                </div>
            </form>

        </div>
    </div>

</div>
<form class="layui-form" action="" th:action="@{/toeditUser}">
    <div class="layui-form-item">
        <div class="layui-input-block">
            <button class="layui-btn" lay-submit lay-filter="formDemo">修改</button>
        </div>
    </div>
</form>


</div>
<script>
    layui.use(['element', 'layer'], function(){
        var element = layui.element;
        var layer = layui.layer;

        //监听折叠
        element.on('collapse(test)', function(data){
            layer.msg('展开状态：'+ data.show);
        });
    });
</script>
</body>
</html>